
public class Evkclass
{
	public static void Evklid(int a,int b)
	{
		while (a!=0 && b!=0) {
		if (a>b)
		a=a%b;
		else
		b=b%a;
		}
		System.out.println(a+b);
	}
	public static void main(String[] args)
	{
		int j=30456;
		int i=2350;
		long start = System.nanoTime();
		Evklid(j,i);
		long end = System.nanoTime();
		long traceTime = end-start;
		System.out.println(traceTime);

	}

}
